package com.odais.UserManagement;

import android.content.Context;
import android.content.SharedPreferences;

/**
 *
 * @author Lionel DECELLE
 * @since 8 juin 2012 - 10:52:42
 *
 */
public class UserID{

	private static final int MODE_WORLD_READABLE = 1;
	private Context mContext;
	public String UserID = null;

	public UserID(Context context)
	{
		mContext = context;
		UserID = new String();
        SharedPreferences myODAISOptions = mContext.getSharedPreferences("myODAISOptions", MODE_WORLD_READABLE);
        UserID = myODAISOptions.getString("odais_user_id", "ndef");

	}

	public void setUserID(String userID) {
		UserID = userID;

        SharedPreferences myODAISOptions = mContext.getSharedPreferences("myODAISOptions", MODE_WORLD_READABLE);
        SharedPreferences.Editor prefsEditor = myODAISOptions.edit();
        prefsEditor.putString("odais_user_id", UserID);
        prefsEditor.commit();
	}

	public String getUserID() {
		return UserID;
	}
}